
$(function() {

    //注册
    $(".mg-register").click(function(){
        var username = $("#username").val();
        var pwd = $("#pwd").val();
        var data = {
                "account":username,
                "password":pwd
            };
        console.log(data);
         $.ajax({
            type: "POST",
            url: 'http://106.75.143.27/admins/register',
            data: JSON.stringify(data),
            dataType: 'json',
            contentType:'application/json',
            success: function(json) {
               if (json.status == true) {
                    location.href="student-mg.html";
                    
                }else{
                    alert(json.message);
                }
            },
            error: function(json) {
                 alert("error"+json.message);
                 return false;
            }
        });
   
    })

});
   

